(function(app){
	
	app.action(['/hello'], 'accountSafe/hello.html', ['$scope', '$route', '_API', '$location', '$timeout', '$rootScope',
		function($scope, $route, _API, $location, $timeout, $rootScope) {
		
	}]);
	
	app.action(['/accountSafe'], 'accountSafe/accountSafe.html', ['$scope', '$route', '_API', '$location', '$timeout', '$rootScope',
		function($scope, $route, _API, $location, $timeout, $rootScope) {
		
		$('#updatePass').click(function() {
			var AA002 = document.getElementById("AA002").value;
			var AA002_1 = document.getElementById("AA002_1").value;
			var AA002_2 = document.getElementById("AA002_2").value;
			/** 校验密码格式 */
		    var result = checkPass2(AA002);
		    if(result == false){alert("原密码格式不正确，请重新输入");return;}
		    var result = checkPass(AA002_1);
		    if(result == false){alert("新密码格式不正确，请重新输入");return;}
		    if(AA002_2 != AA002_1){
              	alert('两次新密码输入不一致，请核对！');
              	return ;
              }
			
			_API.ajax("myAccount/accountSafe/updatePass", {"AA002":AA002,"AA002_1":AA002_1})
	            .success(function(json){
	            	if(json.result.isPass == true){
	            		alert(json.result.info);
	            		sessionStorage.clear();
	            		$location.path('/login');
	            	} else {
	            		alert(json.result.info);
	            	}
	        });
		})
	}]);
	
})($SDC.app);